package com.wyw.log.learning.custom_exception;

/**
 * @Title   为业务/框架定义的专用异常
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2024/3/28 17:56
 * Update History:
 * Author        Time            Content
 */
public class ProfessionalException {

    public static class BizException extends RuntimeException {
        //定义错误码，还可以继续扩展定义各种属性
        public String errorCode;

        public BizException (String errorCode, String message){
            super(message);
            this.errorCode = errorCode;
        }
    }

    /**
     * 自定义商品模块的异常类：查看商品
     */
    public static class ViewGoodsException extends BizException {

        public ViewGoodsException(String errorCode, String message) {
            super(errorCode, message);
        }
    }
}
